<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../Public/js/jquery-1.7.1.min.js"></script>
<title>发表文章</title>
<script type="text/javascript">

 function selectitem(index){
   switch(index){
    case 0:
    window.location.href="{:U('Public/tohome')}"
    break;
    case 1:
    window.location.href="{:U('Upload/uploadpicture')}"
    break;
    case 2:
    window.location.href="{:U('Note/addBlog')}"
    break;
    case 3:
    window.location.href="{:U('First/Index')}"
    break;
    case 4:
    window.location.href="{:U('Favorite/Index')}"
    break;
    case 5:
    window.location.href="{:U('Video/addVideo')}"
    break;
    case 6:
    window.location.href="{:U('Growth/Index')}"
    break;
    case 7:
    window.location.href="{:U('Timeshow/Index')}"
    break;
   }
}

function sendData(){
    var title=$("#discusstitle").val();  
    var contents=$("#contents").val();
    var sel = document.getElementById("leimu");
    var selvalue = sel.options[sel.selectedIndex].value;
    $.post("addArticle",{'title':title,'contents':contents,'selvalue':selvalue},function(data){    
            var jsonObj = $.parseJSON(data);
            if(data!=null){
                var url = "myArticle/catid/"+jsonObj.info;
                window.location.href="{:U('"+url+"')}";
            }else{
                alert("没有添加成功")
            }
  	});  
}

</script>
<style>

div{
	margin:0px;
	margin-left:auto;
	margin-right:auto;
	
	/*border:solid ;
	border-color:#Ff0000;*/
	}
body {
	background:#ffffff;
	margin:0px;	
}


div{
	margin-left:auto;
	margin-right:auto;
	}


.tab{
	border:thin solid #d0d0d0;
	float:left;
	height:39px;
	border-bottom:none;
	line-height:39px;
	font-size:16px;
	color:#626262;
	text-align:center;
	width:80px;
	font-weight:bold;
	cursor:pointer;
	}	
.setab{
	background:#d8f3fe;
	color:#1f9692;
	}
.options{
	height:30px;
	width:170px;
	border-bottom:dotted #e3e3e3 1px;
	cursor:pointer;
	}	
</style>

</head>

<body  >
<div style="margin-top:2%;width:100%;">
	<div style="float:left;width:67%;margin-top:2%;">
  
     <!--标题栏开始-->  
		<div style="width:90%;height:40px; background:#ecf9fe; border: thin solid #dee3e3; margin-top:10px;">
        <div class="tab myfontstyle" style="width:120px;">发表文章</div>
			
			
		</div>
      <!--标题栏结束-->  
 	  <!--最左区域-->
		<div  style="width:90%;background:#f7fcfe;border-top:none;border:thin solid #dee3e3; height:400px;">      
	  <!--讨论题开始-->
			<div class="myfontstyle" style="width:95%;margin-left:20px;margin-top:20px; height:50px;background:url(../Public/discuss/image/line.png) repeat-x left bottom;">
            	<input type="text" name="discusstitle" id="discusstitle" style="background:#f9fdfe;width:60%;height:25px;"/>
                <select name="leimu"  id="leimu" style="background:#f9fdfe;width:100px">
                        <option value="0">选择类别</option>
                        <option value="1">奶粉</option>
                        <option value="2">如厕训练</option>  
                        <option value="3">讲给孩子的故事</option>
                        <option value="4">宝宝的小名</option>
                        <option value="5">工作的妈妈</option>
                        <option value="6">换尿布的爸爸</option>
                 </select>
            </div>
	  <!--讨论题结束-->
	  <!--详细介绍开始-->
			<div style="width:95%;padding-top:20px;margin-left:20px; height:240px;background:url(../Public/discuss/image/line.png) repeat-x left bottom;">
            	<textarea id="contents" name="contents" style="background:#f9fdfe;width:80%;height:200px;"></textarea>
            </div>
	  <!--详细介绍结束-->
	  <!--评论栏开始-->
			<div style="width:95%;margin-left:20px;height:50px;">
            	<div style="float:left;width:102px;height:37px;background:url(../Public/discuss/image/save.png) no-repeat;cursor:pointer;" onclick="sendData()"></div>
            </div>
	  <!--评论栏结束-->
		</div><!--最左区域-->	  
	</div><!--内容结束-->
   
<div style="float:left;width:3%;background:url(../Public/discuss/image/m_line.png) no-repeat right center;height:600px; "></div><!--中线-->
<!--公告开始-->
<div class="myfontstyle" style="float:left;width:30%;">
	<div style="background:url(../Public/discuss/image/back.png) no-repeat;width:203px;height:214px;margin-top:20px;padding-top:50px;">
    <!--	<div  class="myfontstyle"style="width:80%;color:#A0A0A0;font-size:10pt;">&nbsp;&nbsp;Tang话题是供家长们互相交流的地方，话题是固定的，不能被随意发起，因为它们必须被确定是与宝宝有关，Tang崇尚一切以宝宝为中心，当然，如果您急切的希望与Tang所有的家长们交流某一个话题，请发邮件告诉Tang Team.
    </div>-->
</div>
<!--公告结束-->
   <div  id="role" style="float:left;background:url(../Public/child/image/v_line.png) bottom left repeat-x;width:70%;clear:both;">
    	<div class="options" style="background:url(../Public/child/image/home.png) no-repeat;" onclick="selectitem(0)"></div>	
    	<div class="options" style="background:url(../Public/child/image/addphoto.png) no-repeat;" onclick="selectitem(1)"></div>	
    	<div class="options" style="background:url(../Public/child/image/addvideo.png) no-repeat;" onclick="selectitem(5)"></div>	
    	<div class="options" style="background:url(../Public/child/image/marker.png) no-repeat;" onclick="selectitem(3)"></div>	
    	<div class="options" style="background:url(../Public/child/image/addfavourite.png) no-repeat;" onclick="selectitem(4)"></div>	
    	<div class="options" style="background:url(../Public/child/image/addnote.png) no-repeat;" onclick="selectitem(2)"></div>	
    	<div class="options" style="background:url(../Public/child/image/grow.png) no-repeat;" onclick="selectitem(6)"></div>	
    	<div class="options" style="background:url(../Public/child/image/timeshow.png) no-repeat;" onclick="selectitem(7)"></div>	
    </div>

</div><!--全局框结束--> 
<img src="../Public/discuss/image/flower.png" style="position:absolute;right:0;bottom:0; z-index:-50;" />
</body>
</html>